class Hole(object):

    def __init__( self ):
        self.theta1 = None
        self.theta2 = None 
        seli.pt     = None
        self.d      = None
        self.pts    = []
        self.conecyl = None
        self.plane = None
        self.line = None

    def create( self ):
        theta1 = self.coord(0)
        rh     = self.dh/2.
        r1     = self.r
        r2     = ( r1**2 + rh**2 )**0.5
        r3     = r1
        theta1 = np.deg2rad( theta1 )
        theta2 = np.arctan( rh / self.rc )
        theta3 = theta1
        z1     = self.coord(1)
        z2     = z1
        z3     = z1 + rh
        coords = []
        coords.append( [r1, theta1, z1] )
        coords.append( [r2, theta2, z2] )
        coords.append( [r3, theta3, z3] )
        part = self.conecyl.part
        for x, y, z in coords:
            self.pts.append(\
                part.DatumPointByCoordinate( coords=(x, y, z) ) )
        self.plane = part.DatumPlaneByThreePoints(\
                         point1 = self.pts[0],
                         point2 = self.pts[1],
                         point3 = self.pts[2], 
                                                 )
        #part.MakeSketchTransform(  
        ######################
        mdb.models['r_100_h_200'].ConstrainedSketch(name='__edit__', objectToCopy= mdb.models['r_100_h_200'].sketches['Sketch-2'])
        mdb.models['r_100_h_200'].sketches.changeKey(fromName='__edit__', toName= 'Sketch-2')
        mdb.models['r_100_h_200'].ConstrainedSketch(gridSpacing=19.1, name= '__profile__', sheetSize=764.19, transform= mdb.models['r_100_h_200'].parts['Cylinder'].MakeSketchTransform( sketchPlane=mdb.models['r_100_h_200'].parts['Cylinder'].datums[19], sketchPlaneSide=SIDE1, sketchUpEdge=mdb.models['r_100_h_200'].parts['Cylinder'].edges[1], sketchOrientation=RIGHT, origin=(100.0, 100.0, 0.0)))
        mdb.models['r_100_h_200'].parts['Cylinder'].projectReferencesOntoSketch(filter= COPLANAR_EDGES, sketch=mdb.models['r_100_h_200'].sketches['__profile__'])
        mdb.models['r_100_h_200'].sketches['__profile__'].CircleByCenterPerimeter( center=(0.0, 0.0), point1=(0.0, -10.0))
        mdb.models['r_100_h_200'].sketches['__profile__'].CoincidentConstraint( addUndoState=False, entity1= mdb.models['r_100_h_200'].sketches['__profile__'].vertices[6], entity2= mdb.models['r_100_h_200'].sketches['__profile__'].geometry[2])
        mdb.models['r_100_h_200'].parts['Cylinder'].Wire(sketch= mdb.models['r_100_h_200'].sketches['__profile__'], sketchOrientation=RIGHT, sketchPlane=mdb.models['r_100_h_200'].parts['Cylinder'].datums[19], sketchPlaneSide=SIDE1, sketchUpEdge= mdb.models['r_100_h_200'].parts['Cylinder'].edges[1])
        del mdb.models['r_100_h_200'].sketches['__profile__']
        mdb.models['r_100_h_200'].parts['Cylinder'].PartitionFaceByProjectingEdges( edges= mdb.models['r_100_h_200'].parts['Cylinder'].edges.getSequenceFromMask(( '[#3 ]', ), ), extendEdges=False, faces= mdb.models['r_100_h_200'].parts['Cylinder'].faces.getSequenceFromMask(( '[#1 ]', ), ))

        ############################
